{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": false
   },
   "source": [
    "# K210[分类模型]的训练"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": false
   },
   "source": [
    "##  获取git代码构建环境"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "# 环境默认是搭建好了，不需要重新构建。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "# %%bash\n",
    "# if [ -d \"/home/aistudio/work/k210\" ]; then\n",
    "#   rm -f -r \"/home/aistudio/work/k210\"\n",
    "# fi\n",
    "# # git代码没更新，就没必要删除重新获取"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "# %%bash\n",
    "# cd /home/aistudio/work/\n",
    "# git clone https://gitee.com/ai-liam/k210\n",
    "# #git clone https://github.com/ai-liam/k210\n",
    "## 下载过就不必要下载"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "mkdir: cannot create directory ‘/home/aistudio/external-libraries’: File exists\r\n"
     ]
    }
   ],
   "source": [
    "!mkdir /home/aistudio/external-libraries"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "## 安装过就不必要再安装\n",
    "#!pip install -r /home/aistudio/work/k210/k210_train/requirements.txt -i https://mirrors.aliyun.com/pypi/simple/ -t /home/aistudio/external-libraries"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": false
   },
   "source": [
    "## 上传和设置数据源目录"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "# 把你的 xx.zip 数据上到 work目录，【注意，解压得到的文件名】参考例子数据\n",
    "upload_zip = \"/home/aistudio/data/data110385/classifier_datasets.zip\"\n",
    "#upload_zip = \"/home/aistudio/work/k210/datasets/classifier_datasets.zip\"# demo数据\n",
    "data_unzip = \"/home/aistudio/data/temp/\"\n",
    "data_unzip_last = data_unzip+\"images/\" #最后解压后的目录"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Archive:  /home/aistudio/data/data110385/classifier_datasets.zip\n",
      "   creating: /home/aistudio/data/temp/images/\n",
      "   creating: /home/aistudio/data/temp/images/0/\n",
      "  inflating: /home/aistudio/data/temp/images/0/0.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/1.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/10.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/100.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/101.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/102.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/103.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/104.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/105.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/106.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/107.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/108.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/109.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/11.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/110.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/111.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/112.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/113.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/114.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/115.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/116.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/117.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/118.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/119.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/12.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/120.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/198.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/199.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/2.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/20.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/200.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/201.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/202.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/203.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/204.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/205.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/206.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/207.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/208.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/209.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/21.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/210.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/211.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/212.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/213.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/214.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/215.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/216.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/217.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/218.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/219.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/22.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/220.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/221.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/222.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/223.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/224.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/225.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/226.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/227.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/228.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/229.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/23.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/230.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/231.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/232.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/275.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/276.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/277.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/278.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/279.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/28.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/280.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/281.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/282.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/283.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/284.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/285.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/286.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/287.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/288.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/289.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/29.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/290.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/291.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/292.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/293.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/294.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/295.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/296.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/297.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/150.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/151.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/152.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/153.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/154.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/155.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/156.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/157.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/158.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/159.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/16.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/160.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/161.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/162.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/163.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/164.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/165.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/166.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/167.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/168.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/169.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/17.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/170.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/171.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/51.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/52.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/53.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/54.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/55.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/56.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/57.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/58.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/59.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/6.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/60.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/61.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/62.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/63.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/64.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/65.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/66.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/67.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/68.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/69.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/7.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/70.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/71.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/72.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/73.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/74.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/75.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/121.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/15.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/172.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/197.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/233.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/253.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/274.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/298.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/50.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/76.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/234.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/235.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/236.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/237.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/238.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/239.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/24.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/240.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/241.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/242.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/243.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/244.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/245.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/246.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/247.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/248.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/249.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/25.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/250.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/251.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/252.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/77.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/78.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/79.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/8.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/80.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/81.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/82.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/83.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/84.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/85.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/86.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/87.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/88.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/89.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/9.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/90.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/91.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/92.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/93.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/94.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/95.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/96.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/97.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/98.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/99.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/122.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/123.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/124.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/125.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/126.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/127.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/128.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/129.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/13.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/130.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/131.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/132.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/133.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/134.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/135.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/136.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/137.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/138.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/139.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/14.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/140.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/141.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/142.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/143.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/144.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/145.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/146.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/147.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/148.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/149.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/173.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/174.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/175.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/176.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/177.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/178.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/179.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/18.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/180.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/181.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/182.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/183.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/184.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/185.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/186.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/187.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/188.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/189.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/19.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/190.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/191.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/192.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/193.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/194.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/195.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/196.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/299.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/3.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/30.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/31.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/32.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/33.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/34.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/35.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/36.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/37.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/38.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/39.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/4.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/40.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/41.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/42.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/43.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/44.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/45.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/46.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/47.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/48.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/49.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/5.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/254.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/255.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/256.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/257.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/258.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/259.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/26.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/260.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/261.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/262.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/263.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/264.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/265.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/266.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/267.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/268.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/269.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/27.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/270.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/271.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/272.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/0/273.jpg  \n",
      "   creating: /home/aistudio/data/temp/images/1/\n",
      "  inflating: /home/aistudio/data/temp/images/1/0.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/1.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/10.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/100.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/101.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/102.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/103.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/104.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/105.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/106.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/107.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/108.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/109.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/11.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/110.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/111.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/112.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/113.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/114.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/115.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/116.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/117.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/118.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/119.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/12.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/120.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/198.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/199.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/2.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/20.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/200.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/201.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/202.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/203.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/204.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/205.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/206.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/207.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/208.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/209.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/21.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/210.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/211.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/212.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/213.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/214.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/215.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/216.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/217.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/218.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/219.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/22.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/220.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/221.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/222.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/223.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/224.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/225.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/226.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/227.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/228.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/229.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/23.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/230.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/231.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/232.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/275.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/276.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/277.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/278.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/279.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/28.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/280.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/281.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/282.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/283.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/284.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/285.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/286.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/287.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/288.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/289.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/29.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/290.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/291.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/292.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/293.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/294.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/295.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/296.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/297.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/150.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/151.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/152.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/153.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/154.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/155.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/156.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/157.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/158.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/159.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/16.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/160.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/161.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/162.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/163.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/164.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/165.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/166.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/167.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/168.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/169.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/17.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/170.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/171.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/51.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/52.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/53.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/54.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/55.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/56.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/57.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/58.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/59.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/6.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/60.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/61.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/62.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/63.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/64.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/65.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/66.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/67.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/68.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/69.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/7.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/70.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/71.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/72.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/73.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/74.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/75.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/121.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/15.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/172.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/197.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/233.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/253.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/274.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/298.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/50.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/76.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/234.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/235.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/236.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/237.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/238.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/239.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/24.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/240.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/241.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/242.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/243.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/244.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/245.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/246.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/247.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/248.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/249.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/25.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/250.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/251.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/252.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/77.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/78.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/79.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/8.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/80.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/81.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/82.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/83.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/84.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/85.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/86.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/87.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/88.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/89.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/9.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/90.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/91.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/92.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/93.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/94.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/95.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/96.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/97.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/98.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/99.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/122.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/123.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/124.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/125.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/126.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/127.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/128.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/129.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/13.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/130.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/131.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/132.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/133.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/134.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/135.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/136.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/137.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/138.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/139.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/14.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/140.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/141.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/142.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/143.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/144.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/145.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/146.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/147.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/148.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/149.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/173.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/174.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/175.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/176.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/177.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/178.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/179.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/18.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/180.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/181.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/182.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/183.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/184.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/185.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/186.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/187.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/188.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/189.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/19.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/190.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/191.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/192.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/193.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/194.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/195.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/196.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/299.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/3.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/30.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/31.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/32.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/33.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/34.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/35.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/36.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/37.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/38.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/39.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/4.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/40.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/41.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/42.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/43.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/44.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/45.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/46.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/47.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/48.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/49.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/5.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/254.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/255.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/256.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/257.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/258.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/259.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/26.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/260.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/261.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/262.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/263.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/264.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/265.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/266.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/267.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/268.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/269.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/27.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/270.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/271.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/272.jpg  \n",
      "  inflating: /home/aistudio/data/temp/images/1/273.jpg  \n",
      "\n"
     ]
    }
   ],
   "source": [
    "import os\n",
    "\n",
    "cmd = f\"unzip -o -d {data_unzip} {upload_zip}\"\n",
    "f=os.popen(cmd)\n",
    "print(f.read())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": false
   },
   "source": [
    "## 开始训练"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "2410414.ipynb  data  external-libraries  work\r\n"
     ]
    }
   ],
   "source": [
    "import sys \n",
    "sys.path.append('/home/aistudio/external-libraries')\n",
    "sys.path.append('/home/aistudio/work/k210/k210_train')\n",
    "\n",
    "!ls"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "import os, sys\n",
    "import time\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "from train.classifier_v1 import classifier_train\n",
    "from train.classifier.instance import config\n",
    "\n",
    "config.classifier_train_epochs = 4 # 修改训练轮数 40"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "2021-09-27_09_43\n"
     ]
    }
   ],
   "source": [
    "cur_time = time.strftime(\"%Y-%m-%d_%H_%M\", time.localtime())\n",
    "print(cur_time)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "root_dir: /home/aistudio/work/k210\n",
      "temp_saves_dir: /home/aistudio/work/k210/ubuntu/out/imgn_2021-09-27_09_43/\n",
      "datasets_dir: /home/aistudio/work/data/images/\n"
     ]
    }
   ],
   "source": [
    "root_dir =  os.path.abspath('./work/k210') # \"/home/aistudio/work/k210\"\n",
    "ubuntu_path = f\"out/imgn_{cur_time}\" #用来mac中生成kmodel\n",
    "temp_saves_dir = f\"{root_dir}/ubuntu/{ubuntu_path}/\" #保存文件目录\n",
    "datasets_dir =  data_unzip_last #数据源\n",
    "\n",
    "print(\"root_dir:\",root_dir)\n",
    "print(\"temp_saves_dir:\",temp_saves_dir)\n",
    "print(\"datasets_dir:\",datasets_dir)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "## 清理隐藏文件\n",
    "cmd1 = f\"rm -f {datasets_dir}/.DS_Store\"\n",
    "cmd = f\"rm -f {datasets_dir}/*/.DS_Store\"\n",
    "os.popen(cmd1)\n",
    "f = os.popen(cmd)\n",
    "print(f)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "select gpu fail:NVML Shared Library Not Found\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "2021-09-27 09:43:13,496 - [INFO]:  no GPU, will use [CPU]\n",
      "2021-09-27 09:43:15,717 - [INFO]:  train, labels:['0', '1']\n",
      "2021-09-27 09:43:15,718 - [DEBUG]:  train, datasets dir:/home/aistudio/work/data/images/\n",
      "/home/aistudio/external-libraries/keras/optimizer_v2/optimizer_v2.py:356: UserWarning: The `lr` argument is deprecated, use `learning_rate` instead.\n",
      "  \"The `lr` argument is deprecated, use `learning_rate` instead.\")\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Model: \"model\"\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "input_1 (InputLayer)         [(None, 224, 224, 3)]     0         \n",
      "_________________________________________________________________\n",
      "conv1_pad (ZeroPadding2D)    (None, 226, 226, 3)       0         \n",
      "_________________________________________________________________\n",
      "conv1 (Conv2D)               (None, 112, 112, 24)      648       \n",
      "_________________________________________________________________\n",
      "conv1_bn (BatchNormalization (None, 112, 112, 24)      96        \n",
      "_________________________________________________________________\n",
      "conv1_relu (ReLU)            (None, 112, 112, 24)      0         \n",
      "_________________________________________________________________\n",
      "conv_dw_1 (DepthwiseConv2D)  (None, 112, 112, 24)      216       \n",
      "_________________________________________________________________\n",
      "conv_dw_1_bn (BatchNormaliza (None, 112, 112, 24)      96        \n",
      "_________________________________________________________________\n",
      "conv_dw_1_relu (ReLU)        (None, 112, 112, 24)      0         \n",
      "_________________________________________________________________\n",
      "conv_pw_1 (Conv2D)           (None, 112, 112, 48)      1152      \n",
      "_________________________________________________________________\n",
      "conv_pw_1_bn (BatchNormaliza (None, 112, 112, 48)      192       \n",
      "_________________________________________________________________\n",
      "conv_pw_1_relu (ReLU)        (None, 112, 112, 48)      0         \n",
      "_________________________________________________________________\n",
      "conv_pad_2 (ZeroPadding2D)   (None, 114, 114, 48)      0         \n",
      "_________________________________________________________________\n",
      "conv_dw_2 (DepthwiseConv2D)  (None, 56, 56, 48)        432       \n",
      "_________________________________________________________________\n",
      "conv_dw_2_bn (BatchNormaliza (None, 56, 56, 48)        192       \n",
      "_________________________________________________________________\n",
      "conv_dw_2_relu (ReLU)        (None, 56, 56, 48)        0         \n",
      "_________________________________________________________________\n",
      "conv_pw_2 (Conv2D)           (None, 56, 56, 96)        4608      \n",
      "_________________________________________________________________\n",
      "conv_pw_2_bn (BatchNormaliza (None, 56, 56, 96)        384       \n",
      "_________________________________________________________________\n",
      "conv_pw_2_relu (ReLU)        (None, 56, 56, 96)        0         \n",
      "_________________________________________________________________\n",
      "conv_dw_3 (DepthwiseConv2D)  (None, 56, 56, 96)        864       \n",
      "_________________________________________________________________\n",
      "conv_dw_3_bn (BatchNormaliza (None, 56, 56, 96)        384       \n",
      "_________________________________________________________________\n",
      "conv_dw_3_relu (ReLU)        (None, 56, 56, 96)        0         \n",
      "_________________________________________________________________\n",
      "conv_pw_3 (Conv2D)           (None, 56, 56, 96)        9216      \n",
      "_________________________________________________________________\n",
      "conv_pw_3_bn (BatchNormaliza (None, 56, 56, 96)        384       \n",
      "_________________________________________________________________\n",
      "conv_pw_3_relu (ReLU)        (None, 56, 56, 96)        0         \n",
      "_________________________________________________________________\n",
      "conv_pad_4 (ZeroPadding2D)   (None, 58, 58, 96)        0         \n",
      "_________________________________________________________________\n",
      "conv_dw_4 (DepthwiseConv2D)  (None, 28, 28, 96)        864       \n",
      "_________________________________________________________________\n",
      "conv_dw_4_bn (BatchNormaliza (None, 28, 28, 96)        384       \n",
      "_________________________________________________________________\n",
      "conv_dw_4_relu (ReLU)        (None, 28, 28, 96)        0         \n",
      "_________________________________________________________________\n",
      "conv_pw_4 (Conv2D)           (None, 28, 28, 192)       18432     \n",
      "_________________________________________________________________\n",
      "conv_pw_4_bn (BatchNormaliza (None, 28, 28, 192)       768       \n",
      "_________________________________________________________________\n",
      "conv_pw_4_relu (ReLU)        (None, 28, 28, 192)       0         \n",
      "_________________________________________________________________\n",
      "conv_dw_5 (DepthwiseConv2D)  (None, 28, 28, 192)       1728      \n",
      "_________________________________________________________________\n",
      "conv_dw_5_bn (BatchNormaliza (None, 28, 28, 192)       768       \n",
      "_________________________________________________________________\n",
      "conv_dw_5_relu (ReLU)        (None, 28, 28, 192)       0         \n",
      "_________________________________________________________________\n",
      "conv_pw_5 (Conv2D)           (None, 28, 28, 192)       36864     \n",
      "_________________________________________________________________\n",
      "conv_pw_5_bn (BatchNormaliza (None, 28, 28, 192)       768       \n",
      "_________________________________________________________________\n",
      "conv_pw_5_relu (ReLU)        (None, 28, 28, 192)       0         \n",
      "_________________________________________________________________\n",
      "conv_pad_6 (ZeroPadding2D)   (None, 30, 30, 192)       0         \n",
      "_________________________________________________________________\n",
      "conv_dw_6 (DepthwiseConv2D)  (None, 14, 14, 192)       1728      \n",
      "_________________________________________________________________\n",
      "conv_dw_6_bn (BatchNormaliza (None, 14, 14, 192)       768       \n",
      "_________________________________________________________________\n",
      "conv_dw_6_relu (ReLU)        (None, 14, 14, 192)       0         \n",
      "_________________________________________________________________\n",
      "conv_pw_6 (Conv2D)           (None, 14, 14, 384)       73728     \n",
      "_________________________________________________________________\n",
      "conv_pw_6_bn (BatchNormaliza (None, 14, 14, 384)       1536      \n",
      "_________________________________________________________________\n",
      "conv_pw_6_relu (ReLU)        (None, 14, 14, 384)       0         \n",
      "_________________________________________________________________\n",
      "conv_dw_7 (DepthwiseConv2D)  (None, 14, 14, 384)       3456      \n",
      "_________________________________________________________________\n",
      "conv_dw_7_bn (BatchNormaliza (None, 14, 14, 384)       1536      \n",
      "_________________________________________________________________\n",
      "conv_dw_7_relu (ReLU)        (None, 14, 14, 384)       0         \n",
      "_________________________________________________________________\n",
      "conv_pw_7 (Conv2D)           (None, 14, 14, 384)       147456    \n",
      "_________________________________________________________________\n",
      "conv_pw_7_bn (BatchNormaliza (None, 14, 14, 384)       1536      \n",
      "_________________________________________________________________\n",
      "conv_pw_7_relu (ReLU)        (None, 14, 14, 384)       0         \n",
      "_________________________________________________________________\n",
      "conv_dw_8 (DepthwiseConv2D)  (None, 14, 14, 384)       3456      \n",
      "_________________________________________________________________\n",
      "conv_dw_8_bn (BatchNormaliza (None, 14, 14, 384)       1536      \n",
      "_________________________________________________________________\n",
      "conv_dw_8_relu (ReLU)        (None, 14, 14, 384)       0         \n",
      "_________________________________________________________________\n",
      "conv_pw_8 (Conv2D)           (None, 14, 14, 384)       147456    \n",
      "_________________________________________________________________\n",
      "conv_pw_8_bn (BatchNormaliza (None, 14, 14, 384)       1536      \n",
      "_________________________________________________________________\n",
      "conv_pw_8_relu (ReLU)        (None, 14, 14, 384)       0         \n",
      "_________________________________________________________________\n",
      "conv_dw_9 (DepthwiseConv2D)  (None, 14, 14, 384)       3456      \n",
      "_________________________________________________________________\n",
      "conv_dw_9_bn (BatchNormaliza (None, 14, 14, 384)       1536      \n",
      "_________________________________________________________________\n",
      "conv_dw_9_relu (ReLU)        (None, 14, 14, 384)       0         \n",
      "_________________________________________________________________\n",
      "conv_pw_9 (Conv2D)           (None, 14, 14, 384)       147456    \n",
      "_________________________________________________________________\n",
      "conv_pw_9_bn (BatchNormaliza (None, 14, 14, 384)       1536      \n",
      "_________________________________________________________________\n",
      "conv_pw_9_relu (ReLU)        (None, 14, 14, 384)       0         \n",
      "_________________________________________________________________\n",
      "conv_dw_10 (DepthwiseConv2D) (None, 14, 14, 384)       3456      \n",
      "_________________________________________________________________\n",
      "conv_dw_10_bn (BatchNormaliz (None, 14, 14, 384)       1536      \n",
      "_________________________________________________________________\n",
      "conv_dw_10_relu (ReLU)       (None, 14, 14, 384)       0         \n",
      "_________________________________________________________________\n",
      "conv_pw_10 (Conv2D)          (None, 14, 14, 384)       147456    \n",
      "_________________________________________________________________\n",
      "conv_pw_10_bn (BatchNormaliz (None, 14, 14, 384)       1536      \n",
      "_________________________________________________________________\n",
      "conv_pw_10_relu (ReLU)       (None, 14, 14, 384)       0         \n",
      "_________________________________________________________________\n",
      "conv_dw_11 (DepthwiseConv2D) (None, 14, 14, 384)       3456      \n",
      "_________________________________________________________________\n",
      "conv_dw_11_bn (BatchNormaliz (None, 14, 14, 384)       1536      \n",
      "_________________________________________________________________\n",
      "conv_dw_11_relu (ReLU)       (None, 14, 14, 384)       0         \n",
      "_________________________________________________________________\n",
      "conv_pw_11 (Conv2D)          (None, 14, 14, 384)       147456    \n",
      "_________________________________________________________________\n",
      "conv_pw_11_bn (BatchNormaliz (None, 14, 14, 384)       1536      \n",
      "_________________________________________________________________\n",
      "conv_pw_11_relu (ReLU)       (None, 14, 14, 384)       0         \n",
      "_________________________________________________________________\n",
      "conv_dw_12 (DepthwiseConv2D) (None, 14, 14, 384)       3456      \n",
      "_________________________________________________________________\n",
      "conv_dw_12_bn (BatchNormaliz (None, 14, 14, 384)       1536      \n",
      "_________________________________________________________________\n",
      "conv_dw_12_relu (ReLU)       (None, 14, 14, 384)       0         \n",
      "_________________________________________________________________\n",
      "conv_pw_12 (Conv2D)          (None, 14, 14, 768)       294912    \n",
      "_________________________________________________________________\n",
      "conv_pw_12_bn (BatchNormaliz (None, 14, 14, 768)       3072      \n",
      "_________________________________________________________________\n",
      "conv_pw_12_relu (ReLU)       (None, 14, 14, 768)       0         \n",
      "_________________________________________________________________\n",
      "conv_dw_13 (DepthwiseConv2D) (None, 14, 14, 768)       6912      \n",
      "_________________________________________________________________\n",
      "conv_dw_13_bn (BatchNormaliz (None, 14, 14, 768)       3072      \n",
      "_________________________________________________________________\n",
      "conv_dw_13_relu (ReLU)       (None, 14, 14, 768)       0         \n",
      "_________________________________________________________________\n",
      "conv_pw_13 (Conv2D)          (None, 14, 14, 768)       589824    \n",
      "_________________________________________________________________\n",
      "conv_pw_13_bn (BatchNormaliz (None, 14, 14, 768)       3072      \n",
      "_________________________________________________________________\n",
      "conv_pw_13_relu (ReLU)       (None, 14, 14, 768)       0         \n",
      "_________________________________________________________________\n",
      "global_average_pooling2d (Gl (None, 768)               0         \n",
      "_________________________________________________________________\n",
      "dropout (Dropout)            (None, 768)               0         \n",
      "_________________________________________________________________\n",
      "dense (Dense)                (None, 2)                 1538      \n",
      "=================================================================\n",
      "Total params: 1,834,514\n",
      "Trainable params: 1,538\n",
      "Non-trainable params: 1,832,976\n",
      "_________________________________________________________________\n",
      "Found 480 images belonging to 2 classes.\n",
      "self.labels:::: dict_keys(['0', '1'])\n",
      "Found 120 images belonging to 2 classes.\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "2021-09-27 09:43:16,930 - [INFO]:  train data:480, valid data:120\n",
      "/home/aistudio/external-libraries/keras/engine/training.py:1972: UserWarning: `Model.fit_generator` is deprecated and will be removed in a future version. Please use `Model.fit`, which supports generators.\n",
      "  warnings.warn('`Model.fit_generator` is deprecated and '\n",
      "2021-09-27 09:43:17,265 - [INFO]:  train start\n",
      "2021-09-27 09:43:17,266 - [INFO]:  progress: 1.0%, train start\n",
      "2021-09-27 09:43:17,325 - [INFO]:  epoch 0 start\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Epoch 1/4\n",
      "96/96 [==============================] - 52s 519ms/step - loss: 0.6642 - accuracy: 0.5958 - val_loss: 0.6237 - val_accuracy: 0.65\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "2021-09-27 09:44:09,270 - [INFO]:  epoch 0 end: {'loss': 0.6642261147499084, 'accuracy': 0.5958333611488342, 'val_loss': 0.6237415671348572, 'val_accuracy': 0.6499999761581421}\n",
      "2021-09-27 09:44:09,272 - [INFO]:  progress: 25.25%, train epoch end\n",
      "2021-09-27 09:44:09,381 - [INFO]:  epoch 1 start\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Epoch 2/4\n",
      "75/96 [======================>.......] - ETA: 9s - loss: 0.5686 - accuracy: 0.722"
     ]
    }
   ],
   "source": [
    "# 配置文件：train.classifier.instance\n",
    "result,_,model_path ,labels = classifier_train(datasets_dir=datasets_dir,temp_datasets_dir=temp_saves_dir,config=config)\n",
    "\n",
    "#result,_,model_path ,labels = classifier_train(datasets_zip_path=datasets_dir,temp_datasets_dir=temp_saves_dir,config=config)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "print(\"model_path:\",model_path)\n",
    "print(\"labels:\",labels)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": false
   },
   "source": [
    "## 生成k210专用模型 kmodel"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "'''\n",
    "上传 ncc文件\n",
    "下载：https://github.com/kendryte/nncase/releases/tag/v0.1.0-rc5\n",
    "\n",
    "unzip -o -d /home/aistudio/work/ /home/aistudio/work/ncc-linux-x86_64.zip\n",
    "目录为：\n",
    "~/work$ ls\n",
    "ncc-linux-x86_64  ncc-linux-x86_64.zip\n",
    "'''"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "import os\n",
    "\n",
    "ncc_path = \"/home/aistudio/work/ncc-linux-x86_64/ncc\" # 百度平台\n",
    "cmd_linux = f\"{ncc_path} -i tflite -o k210model --dataset {temp_saves_dir}sample_images {temp_saves_dir}m.tflite {temp_saves_dir}result/m.kmodel\"\n",
    "print(cmd_linux)\n",
    "\n",
    "# -i tflite -o k210model --dataset ./$1/sample_images ./$1/m.tflite ./$1/result/m.kmodel"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "f=os.popen(cmd_linux)\n",
    "print(f.read())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "# 生成的文件\n",
    "cmd = f\"ls {temp_saves_dir}result\"\n",
    "print(\"cmd:\",cmd)\n",
    "f=os.popen(cmd)\n",
    "print(f.read())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": false
   },
   "source": [
    "## 生成k210程序boot.py"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "target_file = f\"{temp_saves_dir}result/boot.py\"\n",
    "copy_file = f\"cp -f {root_dir}/k210_train/data/template/imgn_boot.py {target_file}\"\n",
    "print(copy_file)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "f=os.popen(copy_file)\n",
    "print(f.read())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "# 更新 labels \n",
    "result_boot_py_path = target_file\n",
    "\n",
    "img_size = [224,224]\n",
    "#labels = [\"right\", \"left\", \"forward\"]\n",
    "replace = 'labels = [\"{}\"]'.format('\", \"'.join(labels))\n",
    "\n",
    "with open(result_boot_py_path) as f:\n",
    "            boot_py = f.read()\n",
    "with open(result_boot_py_path, \"w\") as f:\n",
    "            target = 'labels = [\"0\", \"1\"] # labels'\n",
    "            boot_py = boot_py.replace(target, replace)\n",
    "            target = 'img_size = [224,224] # img_size'\n",
    "            replace = 'img_size = [{},{}]'.format(img_size[0], img_size[1])\n",
    "            boot_py = boot_py.replace(target, replace)\n",
    "            f.write(boot_py)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": false
   },
   "source": [
    "## 更新到k210 的cube硬件上运行"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "# 生成的文件\n",
    "cmd = f\"ls {temp_saves_dir}result\"\n",
    "print(\"cmd:\",cmd)\n",
    "f=os.popen(cmd)\n",
    "print(f.read())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "'''\n",
    "把 \n",
    "├── result\n",
    "│   ├── boot.py\n",
    "│   └── m.kmodel\n",
    "\n",
    "的 boot.py ，m.kmodel 复制到 sd 卡的根目录下（或者 models/m8/目录下）\n",
    "重新启动硬件，就可以运行了\n",
    "boot.py 代码中核实模型的路径是否正确\n",
    "'''"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "py35-paddle1.2.0"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
